﻿namespace OasisCiq.Xpil
{
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using CommonTypes;
    using External;
    using Xal;
    using XS;

    /// <summary>
    /// A container to define the Date of Birth details of a person
    /// </summary>
    public class BirthInfo : List<BirthInfoElement>, IDataQualityGroup, IExtendedAttributes
    {
        public BirthInfo()
        {
        }

        public BirthInfo(int capacity)
            : base(capacity)
        {
        }

        public BirthInfo(IEnumerable<BirthInfoElement> collection)
            : base(collection)
        {
        }

        /// <summary>
        /// Full location details (e.g. address) may be required
        /// to get the exact geo-cordinates for astrology purposes
        /// </summary>
        public AddressType BirthPlaceDetails { get; set; }

        /// <summary>
        /// Birth data and time to the known precision. Usually, it is only 
        /// the date that is known. Leave time as 00:00:00 if not known.
        /// </summary>
        public XSDateTime BirthDateTime { get; set; }

        /// <summary>
        /// Specify the duration of the uncertainity period as a range where
        /// BirthDateTime is in the middle of the range. Uses xsd:duration as the data type.
        /// The time interval is in the format: PnYnMnDTnHnMnSP: period (required), 
        /// nY: number of years, nM: number of months, nD: number of days, 
        /// T: start of a time section (required if hours, minutes or secords to be specified),
        /// nH: number of hours, nM: number of minutes, 
        /// nS: number of seconds P5Y -> period of 5 years 
        /// P5Y2M10D -> 5 years, 2 months, 10 days, and 15 hours
        /// </summary>
        public XSDuration BirthDateTimePrecision { get; set; }

        /// <summary>
        /// This attribute indicates what level of trust can be given to the parent element.
        /// Omit this attribute if the data quality is unknown. If the data quality is known,
        /// the value is "Valid, else "InValid"
        /// </summary>
        public DataQualityTypeList DataQualityType { get; set; }

        /// <summary>
        /// Date the data quality is valid from
        /// </summary>
        public XSDateTime ValidFrom { get; set; }

        /// <summary>
        /// Date the data quality is valid to
        /// </summary>
        public XSDateTime ValidTo { get; set; }

        public NameValueCollection ExtendedAttributes { get; set; }
    }
}
